import Layout from "@/layout";

// 静态路由
export const constantRoutes = [
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true,
  },

  {
    path: "/404",
    component: () => import("@/views/404"),
    hidden: true,
  },

  {
    path: "/",
    component: Layout,
    redirect: "/dashboard",
    children: [
      {
        path: "dashboard",
        name: "Dashboard",
        component: () => import("@/views/dashboard/index"),
        meta: { title: "首页", icon: "dashboard" },
      },
    ],
  },
];

// 动态路由
export const allAsyncRoutes = [
  {
    path: "/acl",
    name: "Acl",
    component: () => import("@/layout/index.vue"),
    redirect: "/user",
    meta: {
      title: "权限管理",
      icon: "setting",
    },
    children: [
      {
        path: "user",
        component: () => import("@/views/User"),
        name: "User",
        meta: { title: "用户管理", icon: "user" },
      },
      {
        path: "role",
        name: "Role",
        component: () => import("@/views/Role"),
        meta: { title: "角色管理", icon: "user" },
      },
      {
        name: "RoleAuth",
        path: "role/auth",
        component: () => import("@/views/Role/roleAuth"),
        meta: {
          title: "角色管理",
          activeMenu: "/acl/role",
        },
        hidden: true,
      },
    ],
  },

  {
    path: "/product",
    name: "Product",
    redirect: "/trademark",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "商品管理",
      icon: "shopping",
    },
    children: [
      {
        path: "trademark",
        component: () => import("@/views/Trademark/index"),
        name: "Trademark",
        meta: { title: "品牌管理", icon: "table" },
      },
      {
        path: "sku",
        component: () => import("@/views/Sku"),
        name: "Sku",
        meta: { title: "SKU管理", icon: "table" },
      },
    ],
  },
];

// 任意路由
export const anyRoute = { path: "*", redirect: "/404", hidden: true }
